/*
 * Alert.fx
 *
 * Created on 19.2.2010, 18:36:
 */
package com.gpsbuddy.components;

import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.shape.Rectangle;
import com.gpsbuddy.graphics.closeUI;
import javafx.scene.Group;
import javafx.scene.paint.Color;

/**
 * @author jonycus
 */
public class Alert extends CustomNode {

    public var width:Number;
    public var height:Number;

    var rect = Rectangle {
                width: bind width;
                height: bind height;
                layoutX: 3;
                layoutY: scene.height * 2 / 3;
                arcWidth: 5;
                arcHeight: 5;
                fill:  Color.DARKGRAY;
                opacity: 0.9;
            }
            
    var closeButton = closeUI {
                layoutX: bind rect.width - 35;
                layoutY: 15;
                nodeToBeClosed: this;
            }

    var group = Group {
        content: [rect, closeButton]
    }

    override protected function create(): Node {
        return group;
    }

}
